﻿/* 拖动 操作相关的js. add by terry */

// 拖动开始.
var dragstart=function(d, i) {
    console.info(d3.event.subject)
    _this.force.stop();
    d3.event.sourceEvent.stopPropagation();
};

// 拖动中.
var dragmove=function(d, i) {
    d.px += d3.event.dx;
    d.py += d3.event.dy;
    d.x += d3.event.dx;
    d.y += d3.event.dy;
    _this.tick();
};

// 拖拽完毕执行的效果.
var dragend=function(d, i) {
    d3.event.subject.fx = null;
    d3.event.subject.fy = null;
    
    // ano by terry 0614 阻止出现力导向效果.
    // _this.force.restart();
    
    _this.tick();
};


this.nodeDrag = d3.drag()
        .on("start", dragstart)
        .on("drag", dragmove)
        .on("end", dragend);
